home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 476-500 / disk_499 / matlab / matlab.lzh / plot.doc < prev    next >
Text File  |  1991-05-22  |  25KB  |  991 lines

  1. C
  2.  
  3.  
  4.  
  5.  
  6.  
  7.                                MATLAB PLOTS
  8.                           VERSION OF 20 JUNE 1989
  9.                             Brought to you by:
  10.                                 Jim Locker
  11.                                SofTech Inc.
  12.                             4443 N. Hyland Ave.
  13.                               Dayton Oh 45424
  14.                               (513)-429-2771
  15.  
  16.  TABLE OF CONTENTS
  17.  
  18.  CHAPTER                                PAGE
  19.  
  20.  1.0 Introduction                         2
  21.  2.0 The Main Menu                        3
  22.  3.0 3-D Plots                            5
  23.  4.0 X-Y Plots                            7
  24.  5.0 Polar Plots                         10
  25.  6.0 Contour Plots                       12
  26.  7.0 Histograms                          13
  27.  8.0 Using Matlab as a Data Plotter      14
  28.  9.0 Demos                               15
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  1.0 Introduction
  75.  
  76.  Matlab Plot is a flexible and comprehensive plot package for Matlab.  You
  77.  may have as many plots on one  16  color  hi-res  interlace screen as you
  78.  think you can make sense out of.  You may save definitions for as many as
  79.  10  of  those  plots  and  may   display   those  plots  individually  or
  80.  collectively.  This manual  describes  the operation of the plot function
  81.  and some details about each choice.  For  more information on some of the
  82.  choices, you should consult the diglib manual.
  83.  
  84.  To enter matlab plot, type "Plot(x);" from matlab, where x is any matrix.
  85.  This will enter the  plot  interactive  mode.   To enter batch mode, type
  86.  "Plot(x,'filename');" from  matlab.    In  this mode, the filename is the
  87.  name of a previously saved  plot  definition  file.   In batch mode, plot
  88.  will automagically  load  the  plot  file  and  plot  x  according to the
  89.  definitions it finds there, without any other action on your part.
  90.  
  91.  When entering Plot interactively from the CLI, you will first be asked if
  92.  you have set the stack up to at  least  100K.   Answer yes or no.  If you
  93.  say yes when you should have said  no,  you will experience a spectacular
  94.  crash.  If you say no, you will exit to  Matlab.  At this time, save your
  95.  work, exit Matlab, and set your  stack.   Then re-enter Matlab to do your
  96.  plots.  A screen will be opened behind  the Workbench screen.  You should
  97.  click to and from this  screen  using  the  left-Amiga-M  and -N options.
  98.  When a plot is  active,  the  plot  window  will  block  the  plot screen
  99.  front/back gadgets.
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  2.0 The Main Menu
  141.  
  142.  After setting your stack  and  answering  yes  to  the question, you will
  143.  reach the main menu.  This menu says:
  144.  
  145.  PLEASE SELECT AN OPTION:
  146.   1 3D PLOT
  147.   2 X-Y PLOT
  148.   3 POLAR PLOT
  149.   4 CONTOUR PLOT
  150.   5 HISTOGRAM
  151.   6 SET BACKGROUND COLOR
  152.   7 PLOT BUFFER CONTROL
  153.   8 READ PLOT FILE
  154.   9 END THE CURRENT PLOT
  155.  10 EXIT TO MATLAB
  156.  
  157.  Options 1 through 5 will be  discussed  in  the relevant sections of this
  158.  document.
  159.  
  160.  If option 6 is selected, you  will  be  prompted  to  enter a pen number.
  161.  Enter a number from 1 to 15.   The  plot  background  will  be set to the
  162.  color you select.   Sorry...you  cannot  preview  the colors.  At a later
  163.  point I will add that capability.   For  now, you should just experiment.
  164.  If you don't select a background color, the default is black.  Color 1 is
  165.  white, color 2 is red, and so forth.
  166.  
  167.  Option 8 will prompt you to enter a file  name of a previously saved plot
  168.  definition file.  Enter the file name, then sit back and watch.  The file
  169.  will be loaded and the plots will be generated automatically.
  170.  
  171.  Option 9 will end the current plot  and  the  program will hang until you
  172.  click on the close gadget on the plot screen.  You may click on the close
  173.  box at any time, and this  release  of  Matlab  will close the window the
  174.  next time it checks the Intuition message port, which it does frequently.
  175.  
  176.  Option 10 exits Plot to matlab.
  177.  
  178.  Option 7 is the Plot buffer  control.   The  last 10 plot definitions are
  179.  stored in a buffer.  This  option  controls  how  that buffer is handled.
  180.  When option 7 is selected, the following menu appears:
  181.  
  182.  PLEASE CHOOSE THE PLOT BUFFER CONTROL OPTION:
  183.  1 CLEAR THE BUFFER
  184.  2 DELETE A PLOT
  185.  3 SHOW THE PLOT BUFFER
  186.  4 DISPLAY ONE OF THE SAVED PLOTS
  187.  5 DISPLAY ALL SAVED PLOTS
  188.  6 SAVE THE PLOT BUFFER
  189.  7 RETURN TO MAIN MENU
  190.  
  191.  Choosing  option  1  will  clear   the  buffer  and  eliminate  all  plot
  192.  definitions.  Choosing option 2  will  display the contents of the buffer
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  and prompt you to enter a buffer  number  to delete.  That buffer will be
  206.  deleted.  The buffer handler does  not  fill  holes in the buffer so, for
  207.  instance, if you delete plot 2 out of  a three plot buffer, then define a
  208.  new plot, that new plot  will  appear  as  plot  4 and plot 2 will remain
  209.  blank.  The buffer  is  a  first  in-first  out  (FIFO)  buffer  with  10
  210.  locations.   Thus,  location  2  would  remain  blank  until  enough  new
  211.  definitions had been made to overwrite location 1.
  212.  
  213.  Option 3 will show what plots are in the buffer.  Option 4 will result in
  214.  a prompt requesting the plot number  to  display.  Entering a plot buffer
  215.  number  will  result  in  the  display  of  that  plot.   Option  5  will
  216.  immediately generate a plot  using  all  the  definitions  in the buffer.
  217.  Option 6 will prompt for a filename.  The plot definitions will be stored
  218.  in this file for later use.  At  this  time, any holes in the buffer will
  219.  be deleted.
  220.  
  221.  Option 7 will return you to the main menu.
  222.  
  223.  WARNING...Plot does not check  the  dimension  of  an array when plotting
  224.  from  the  buffer  or  from  a   saved   definition  file.   It  is  your
  225.  responsibility to ensure that the array  and the definitions in the saved
  226.  file are compatible.  If they are not,  there is an excellent chance that
  227.  you will crash and burn.  For instance,  do not define a plot for a 50 by
  228.  50 array, then try to plot a 10 by 10  array using that definition.  This
  229.  is guaranteed to get you in trouble.
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  3.0 3-D Plots
  273.  
  274.  Upon choosing main menu option 1, you will be presented with the 3-D plot
  275.  menu.  This menu says:
  276.  
  277.  PLEASE CHOOSE AN OPTION:
  278.  1 CHOOSE PLOT LABELS
  279.  2 CHOOSE PLOT VALUES
  280.  3 CHOOSE VIEWER PERSPECTIVE
  281.  4 CHOOSE HIDDEN LINE OPTIONS
  282.  5 CHOOSE PLOT COLOR
  283.  6 CHOOSE PLOT SIZE
  284.  7 DO THE PLOT
  285.  8 END THE CURRENT PLOT
  286.  9 EXIT 3-D PLOT
  287.  
  288.  If you choose, you may immediately select  option 7 (do the plot) because
  289.  all necessary values for the plot have defaults.
  290.  
  291.  Option 1 will ask you to enter  strings  for the x axis label, the y axis
  292.  label, the z axis label,  and  the  size  (cm)  of  the characters in the
  293.  labels.  The default is to have no labels.
  294.  
  295.  Option 2 will prompt you for x and y limits, and x/z and y/z ratios.  The
  296.  ratios will affect how the plot  will  appear  on the screen.  The values
  297.  default to "good" numbers: the ratios default to 1:1.  I suggest you play
  298.  around to see what works best for you.
  299.  
  300.  Option 3 will prompt you to  enter  a  perspective  in  R, theta, and phi
  301.  values.  Again, experiment.  The default  places you 45 degrees off the x
  302.  axis and 30 degrees above the x y plane.
  303.  
  304.  Option 4 will provide a small menu of  hidden line options.  It is fairly
  305.  self explanatory.  The default is no hidden line removal.
  306.  
  307.  Option 5 sets the pen color of the plot
  308.  
  309.  Option 6 prompts you to enter the space on the screen that the plot is to
  310.  occupy, in fractions of the total  screen  size.  You are first asked for
  311.  the origin of the plot (lower left hand corner) on the screen X axis as a
  312.  fraction of the x axis size.  Thus,  to  start the plot midway across the
  313.  screen, you would enter  0.5.   To  start  the  plot  at  the left of the
  314.  screen, you would enter 0.   Similarly,  for  the Y-axis origin, 0 starts
  315.  the plot at the bottom of the screen and .5 starts it midway up.  You are
  316.  then prompted to enter the fraction of  each screen axis that the plot is
  317.  to occupy.  Again, enter a positive decimal  number.  Please note that if
  318.  the fraction of the axis defining the start point plus the fraction to be
  319.  occupied by the plot is  greater  than  1,  there will be clipping of the
  320.  plot.  Example: to place a plot in the  lower left quarter of the screen,
  321.  the x origin is 0, the y origin  is  0,  the  x fraction is .5, and the y
  322.  fraction is .5.  To place the plot in  the upper right quarter, the x and
  323.  y origins are both .5 and the x and y fractions are also .5.  The default
  324.  values generate a  full  screen  plot.   Note:  the  routine that handles
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  keyboard input  for  Matlab  Plot  is  not  very  smart.   It will accept
  338.  non-numeric input from you  and  happily  convert  it  to a number.  This
  339.  leads to unpredictable results.
  340.  
  341.  Option 7 will immediately display the plot using the current options.
  342.  
  343.  Option 8 will hang the program until you click on the plot close gadget.
  344.  
  345.  Option 9 returns to the main menu.
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.  4.0 X-Y Plots
  405.  
  406.  This is the most complicated  plot  option.   When  you  choose main menu
  407.  option 2, you will encounter a small option menu which says:
  408.  
  409.  PLEASE CHOOSE THE X-Y PLOT MODE
  410.  1 IMPLICIT X, EXPLICIT Y
  411.  2 EXPLICIT X, EXPLICIT Y
  412.  
  413.                                                               There    are
  414.  two types of x-y plotting available  to  you.  In option 1, it is assumed
  415.  that each cell in the  matrix  contains  a  y  value and the x values are
  416.  given by the  position  of  the  cell  in  the  array.   By default, cell
  417.  location 1 will be assigned the  value  x=1,  location 2 gets x=2, and so
  418.  forth.  This  is  similar  to  the  3-D  plot,  but  the  plot  will be 2
  419.  dimensional instead of 3-D.  You might  use this option if you had made a
  420.  3D plot of an array and wanted to also plot specific row or column slices
  421.  out of the array.  As  an  example,  if  you  are  plotting along Rows in
  422.  Matrix X which is an M by N  array,  then  if  you plot along row M1 such
  423.  that 1 >  M1  <  M,  then  the  location  X(M1,1)  contains  Y1  and  the
  424.  corresponding x value  is  assigned  the  value  of  1.  Location X(M1,2)
  425.  contains Y2 and  is  assigned  x=2,  and  so  forth  up  to X(M1,N) which
  426.  contains YN and is assigned x=N.
  427.  
  428.  In option 2, it is assumed  that  the  data  in  the array is arranged in
  429.  ordered pairs, with a Y value in a  cell  corresponding  to an x value in
  430.  another cell.  You may have an array with one row containing the x values
  431.  and all other rows containing y values  that correspond to the x value in
  432.  the x row at the same column  location.   The minimum array dimension for
  433.  this option is 2 by N or M by  2  because  this  option  requires ordered
  434.  pairs.  Again as an example, if you  are  plotting X(M,N) along rows such
  435.  that X(1,N) contains all x values,  and  X(2,N)  contains corresponding Y
  436.  values, then you would select  option  2.  The array could be arranged so
  437.  that X(3,N) contains new x values, and  X(4,N) contains the corresponding
  438.  Y values, X(5,N) contains x, X(6,N)  the  corresponding  Y, and so forth.
  439.  You must have at least one set of x and  one set of y values, but you may
  440.  have as many of each as you choose, arranged in any fashion you see fit.
  441.  
  442.  After choosing one option or the other, you will be informed that you are
  443.  plotting from an  M  row  by  N  column  array  (M  and  N  given  as the
  444.  appropriate numbers) and you  are  asked  whether  to  plot along rows or
  445.  columns.  In other words,  tell  Plot  how  you  want the data organized.
  446.  Choosing rows will result in a plot of successive column locations in the
  447.  same row.  Choosing  columns  will  result  in  a  plot of successive row
  448.  locations in the same column.
  449.  
  450.  After choosing rows or columns, you will  be asked how many lines will be
  451.  placed on the plot.  You may plot from  one to ten sets of ordered pairs,
  452.  or Y values if the implicit x option was chosen.
  453.  
  454.  After choosing the number of lines, you will be prompted to enter the row
  455.  (or column) number of the x  and  y  components  of  each  line.   If the
  456.  implicit x option was chosen, you will be prompted for y components only.
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.  You may choose the same row (or column) as many times as you wish.
  470.  
  471.  After entering this information,  you  will  finally reach the main menu.
  472.  This menu says:
  473.  
  474.  PLEASE CHOOSE AN OPTION:
  475.   1 SELECT THE TYPES OF PLOT AXES
  476.   2 SELECT THE X AND Y GRID MARKINGS
  477.   3 SELECT THE X AND Y AXIS TICK MARK OPTIONS
  478.   4 SELECT THE LINE OPTIONS
  479.   5 SELECT THE PLOT COLORS
  480.   6 SELECT THE BACKGROUND COLOR
  481.   7 SELECT THE AXIS SCALES
  482.   8 CHOOSE THE PLOT SIZE
  483.   9 CHOOSE THE PLOT LABELS
  484.  10 DO THE PLOT
  485.  11 END THE CURRENT PLOT
  486.  12 EXIT XYPLOT
  487.  
  488.  At this point, sufficient information to do a plot has been provided, and
  489.  you may immediately choose option 10 if you wish.
  490.  
  491.  Choosing option 1 will result  in  another  menu  giving  various log and
  492.  linear options which are self explanatory.   You may also choose to place
  493.  a second Y axis on the  right  side  of  the  plot.   If  you choose that
  494.  option, another menu will appear with appropriate choices for that axis.
  495.  
  496.  Option 2 will result in a menu to determine the types of grid markings to
  497.  be applied.
  498.  
  499.  Option 3 will let you choose axis  tick  mark options.  These options are
  500.  cumulative.  You should not choose  any  options for a second y axis tick
  501.  marks if you have previously chosen a second y axis from the axis menu.
  502.  
  503.  Option 4 leads through  successive  menus  to  determine  line and symbol
  504.  types and sizes.  Four line  types  are  available  and  four symbols are
  505.  available.  You may also choose the symbol  spacing (ie every data point,
  506.  every third data point,  etc.)   When  choosing  symbol  size, enter your
  507.  values in centimeters, or fractions thereof.
  508.  
  509.  Option 5 enables you to set the color of any or all of the plot lines, by
  510.  pen number.
  511.  
  512.  Option 6 lets you set the background color for the plot.
  513.  
  514.  Option 7 lets you set the  axis  scales  if  for  some reason the default
  515.  values, which are selected so that all your data will plot on screen, are
  516.  not acceptable.   When  choosing  the  Implicit  X  option, if you do not
  517.  change the x-axis scale, the plot  will  be labeled starting with x=1 and
  518.  going to x=M or N.
  519.  
  520.  Option 8 lets you choose the  plot  size  in  the same fashion as the 3-D
  521.  plot.  If you use a plot title  label,  you must leave room for it at the
  522.  top of the plot.  This means that you should set the y axis size somewhat
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  shorter than if there was no title.    How  much shorter depends upon the
  536.  size of the title.
  537.  
  538.  Option 9 lets you select  plot  labels  for  the  x axis, the y axis, the
  539.  second y axis, and the plot title.   You  do not have to select the label
  540.  size on this plot; that feature  defaults  to  auto-sizing.  However, you
  541.  may choose the size if you wish.
  542.  
  543.  Option 10 will immediately do the plot using the selected options.
  544.  
  545.  Option 11 hangs the program until the plot close gadget is selected.
  546.  
  547.  Option 12 returns to the main menu.
  548.  
  549.  
  550.  
  551.  
  552.  
  553.  
  554.  
  555.  
  556.  
  557.  
  558.  
  559.  
  560.  
  561.  
  562.  
  563.  
  564.  
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.  
  602.  5.0 Polar Plots
  603.  
  604.  This release of Matlab  supports  a  complete  polar  plotting  function.
  605.  Selecting main menu option 3 will get you there.
  606.  
  607.  When you enter the polar  plot  function,  you  are  immediately asked to
  608.  define the plot mode.  You have two choices: R-Theta (type real) mode, in
  609.  which case the data  in  the  array  is  arranged  as  ordered  pairs  of
  610.  radial-angle information; or X+IY  (Complex)  mode,  in which the data in
  611.  the array contains imaginary components.   After choosing a mode, you are
  612.  given a display similar to that  in  the  XYPLOT  routine,  asking you to
  613.  choose plotting along rows or columns.  Pick one.  You are then asked how  
  614.  many data lines to plot.  You may  choose  up  to 10 on one plot.  If you
  615.  chose the R-Theta plot option, you  will  then be prompted, for each line
  616.  to be plotted, to enter the R and  Theta  row  or column numbers.  If you
  617.  chose complex plots, you will  be  prompted  to  enter  the row or column
  618.  number of the complex number data to be plotted.  Then you reach the main
  619.  menu.
  620.  
  621.  This menu says:
  622.  
  623.  PLEASE CHOOSE AN OPTION
  624.  
  625.   1 DEFINE THE PLOT LABEL
  626.   2 CHOOSE PLOT AXIS TYPE
  627.   3 CHOOSE LINE OPTIONS
  628.   4 CHOOSE PLOT AXIS AND TICK MARK OPTIONS
  629.   5 CHOOSE THE BACKGROUND COLOR
  630.   6 CHOOSE THE PLOT COLOR
  631.   7 CHOOSE THE PLOT SIZE
  632.   8 DO THE PLOT
  633.   9 END THE CURRENT PLOT
  634.  10 EXIT POLAR PLOTS.
  635.  
  636.  Option 1 enables you to define a plot label.
  637.  
  638.  Option 2 lets you choose among the alternative radius types.  Two choices 
  639.  are available.  LINEAR does the  plot  with a linear radius.  LOGARITHMIC
  640.  does the plot with a logarithmic radius scale.
  641.  
  642.  Option 3 lets you choose data line options.
  643.  
  644.  Option 4 defines plot axis/tick mark options.   You may choose the number
  645.  of range rings to draw, and  the  line  styles  to use when drawing them.
  646.  The number of range rings to be drawn  is the total number of range rings
  647.  if you are in the linear radius  mode,  or  the number of range rings per
  648.  decade in logarithmic radius mode.
  649.  
  650.  Option 5 lets you set the  background  color.   This does a SetRast() and
  651.  will wipe out any other plots which are currently displayed.  Those plots
  652.  remain defined in the plot buffer, however.
  653.  
  654.  Option 6 lets you choose the color of the axis, range rings, and labels
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.  
  668.  Option 7 lets you choose the size of the  plot.  An improper selection of
  669.  aspect ratio here will result in a  distorted  graph.  The polar plotting
  670.  routine won't correct aspect ratio.
  671.  
  672.  Option 8 does the plot.  You may select  this option as soon as you reach
  673.  the main menu.
  674.  
  675.  Option 9 hangs the program until you click on the close gadget.
  676.  
  677.  Option 10 returns to the main plot menu.
  678.  
  679.  
  680.  
  681.  
  682.  
  683.  
  684.  
  685.  
  686.  
  687.  
  688.  
  689.  
  690.  
  691.  
  692.  
  693.  
  694.  
  695.  
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732.  
  733.  
  734.  6.0 Contour Plots
  735.  
  736.  When you enter the Contour plot  function,  you immediately encounter the
  737.  main menu.  It presents the following display:
  738.  
  739.  PLEASE SELECT AN OPTION:
  740.  1 CHOOSE PLOT LABELS
  741.  2 CHOOSE PLOT VALUES
  742.  3 CHOOSE NUMBER OF CONTOURS
  743.  4 CHOOSE CONTOUR LEVELS
  744.  5 SET THE BACKGROUND COLOR
  745.  6 CHOOSE PLOT COLOR
  746.  7 CHOOSE PLOT SIZE
  747.  8 DO THE PLOT
  748.  9 END THE CURRENT PLOT
  749.  10 EXIT CONTOUR PLOTS
  750.  
  751.  Option 1 enables you to define x and y axis labels for the plot.
  752.  
  753.  Option 2 enables you to define the minimum  and maximum x and y values to
  754.  be displayed on the plot.   By  default,  this  is  an implicit value and
  755.  ranges from X=0, Y=0 to X=M,Y=N where the input array is dimensioned M by
  756.  N.  Choose this option if the default is not acceptable.
  757.  
  758.  Option 3 enables you to choose the number of contour lines to be plotted.
  759.  The default is 20 contours.
  760.  
  761.  Option 4 enables you to  choose  at  what  values  contour  lines will be
  762.  drawn.  By default, they are drawn at  equal intervals in the data.  This
  763.  option enables the user  to  force  contour  drawing  at  specified  data
  764.  values.
  765.  
  766.  Option 5 enables you to set the background  color.  This does a SetRast()
  767.  and therefore obliterates all other plots currently being displayed.  The
  768.  plot definitions remain in the plot buffer.
  769.  
  770.  Option 6 lets you choose the color of the plot.
  771.  
  772.  Option 7 lets you define the size of the plot on the screen.
  773.  
  774.  Option 8 draws the picture  immediately.   You  may select this option as
  775.  soon as you reach the main menu.
  776.  
  777.  Option 9 hangs the program until you click on the window close box.
  778.  
  779.  Option 10 returns to the main menu.
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.  
  800.  7.0 Histograms
  801.  
  802.  The histogram function is  relatively  immature.  In the June 20 release,
  803.  what  is  here  works,  but  you  may  find  it  too  limiting  for  many
  804.  applications.  Try it, if it's useful to you, use it.
  805.  
  806.  Upon selecting option  5  on  the  main  menu,  you  will  encounter  the
  807.  histogram main menu:
  808.  
  809.  PLEASE SELECT AN OPTION:
  810.  1  CHOOSE THE BAR GRAPH TYPE
  811.  2  CHOOSE BAR GRAPH AXIS TYPE
  812.  3  CHOOSE BAR GRAPH AXIS COLORS
  813.  4  CHOOSE BAR GRAPH LABELS
  814.  5  SET THE BAR GRAPH COLORS
  815.  6  SET THE BACKGROUND COLOR
  816.  7  SET THE PLOT SIZE
  817.  8  DO THE PLOT
  818.  9  END THE CURRENT PLOT
  819.  10 EXIT TO MAIN MENU
  820.  
  821.  You may immediately choose option 8  if  you desire; all necessary values
  822.  default.  The histogram is somewhat more  limited in options than the x-y
  823.  plot.  You do not  get  to  choose  whether  to  plot  columns  or  rows;
  824.  histograms are done along rows  only.   Furthermore,  the first 8 rows of
  825.  the array will be histogrammed, one  histogram  per row, with axis scales
  826.  set to include all histograms.  If there are fewer than 8 rows, then only
  827.  that many rows will  be  histogrammed.   Thus,  to get one histogram, you
  828.  must input a 1 by N array, with N less than or equal to 512.
  829.  
  830.  Option 1 allows  you  to  choose  the  histogram  type.   Two  types  are
  831.  available: statistical and occurence count.  In Statistical (the default)
  832.  the histogram will be  normalized  to  one.   Thus,  the maximum possible
  833.  value on the y axis is 1, if all events  fall into the same bin.  This is
  834.  for use in statistical distributions.
  835.  
  836.  In Occurence Count, the  histogram  is  not  normalized.  The Y axis will
  837.  reflect the number of events in each cell.
  838.  
  839.  All other Histogram features work as described in previous sections.
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.  
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.  
  864.  
  865.  
  866.  8.0 Using Matlab as a data plotter
  867.  
  868.  I have been asked how you do this.  Really it is quite simple.  I presume 
  869.  you have an ASCII data file which represents your data, in an appropriate
  870.  format.  To bring it into Matlab,  you  must  edit the data file to place
  871.  the data in a format that Matlab  will  recognize,  then EXECute the file
  872.  from within Matlab.  For instance,  suppose  you  have the following data
  873.  pairs that  represent  data  you  have  collected/generated.   This  data
  874.  represents X-Y ordered pairs:
  875.  
  876.  ***start of dummy ASCII file***
  877.                   x       y
  878.  
  879.                   3       2
  880.                   5       6
  881.                   47.5    13.2
  882.  ***end of dummy ASCII file***
  883.  
  884.  You would edit the file and  remove  all  extraneous  stuff,  such as the
  885.  header, the footer, and the x and y labels.   You would take the data and
  886.  re-format it like this:
  887.  
  888.          x = <
  889.                   3       2;
  890.                   5       6;
  891.                   47.5    13.2;
  892.              >
  893.  
  894.  Then, from within matlab, type:
  895.  
  896.  EXEC('MYDATAFILE')
  897.  
  898.  You have just entered a generalized  ASCII  data file into Matlab and may
  899.  plot it as you choose.
  900.  
  901.  
  902.  
  903.  
  904.  
  905.  
  906.  
  907.  
  908.  
  909.  
  910.  
  911.  
  912.  
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.  
  932.  9.0 Demos
  933.  
  934.  A demonstration of the  plot  features  is  provided  on the distribution
  935.  disk.  The demo will take  a  previously  calculated  2  dimensional Sinc
  936.  function (sin(x)/x * sin(y)/y) and  plot  it 3 ways.  To run the demo, at
  937.  the CLI prompt CD to the disk containing  Matlab.  Increase your stack to
  938.  100000.
  939.  
  940.  Enter "Matlab" (You should not enter the double quotes)
  941.  
  942.  When the Matlab intro is complete  and  the Matlab prompt ( <> ) appears,
  943.  enter:
  944.  
  945.  "Load('sinc.sav')"
  946.  
  947.  After the load operation is complete, enter:
  948.  
  949.  "Plot(z);"
  950.  
  951.  when asked if the stack is set to 90K, enter:
  952.  
  953.  "Y" (unless, of course, you didn't set the stack)
  954.  
  955.  You now reach the main menu.
  956.  
  957.  Choose option 8.  When prompted for a file name, enter:
  958.  
  959.  "sinc2.plt" (do not enter the quotes, just the name)
  960.  
  961.  Now click to the back screen and watch the plotting happen.  It will take
  962.  about 45 seconds to begin; the  3-D  plot  has  been selected with hidden
  963.  line removal activated and that takes some calculation.
  964.  
  965.  You may also  start  Matlab  from  Workbench.   After  starting  it  from
  966.  Workbench, you must load and plot the demo files as described above.
  967.  
  968.  You may execute the script file testit2.exe to see an example of plotting
  969.  from batch mode.
  970.  
  971.  Other demo files may be on the  disk:  those labeled with the suffix .exe
  972.  are script files for Matlab  which  will  cause  calculations  (sometimes
  973.  lengthy) to occur, those with the  suffix  .sav are saved variables which
  974.  may be directly plotted after being  loaded,  and  those labeled .plt are
  975.  plot definition files.  There is  nothing  magic  about these suffixes; I
  976.  simply use them to  keep track of things.  I suggest that you do to.
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.  
  988.  
  989.  
  990.  
  991.